package com.jy.modules.cims.common.sysUtils;

import java.util.ResourceBundle;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 
 * <b>类名称：</b>PropertyUtil <br/>
 * <b>类描述：读取属性文件工具类</b><br/>
 * <b>创建人：</b>chenguixue<br/>
 * <b>修改人：</b><br/>
 * <b>修改时间：</b>2015-2-11 上午11:30:24<br/>
 * <b>修改备注：</b><br/>
 * <b>版本信息：</b>v1.0.0<br/>
 */
public class PropertyUtil {
	private static final Logger logger = LoggerFactory.getLogger(PropertyUtil.class);
	private static ResourceBundle resourceBundle = ResourceBundle.getBundle("cims");

	/**
	 * 根据key值返回value, 统一返回String
	 * 
	 * @param key
	 * @return String
	 * @author chenguixue
	 * @date 2015-2-11-上午11:31:03
	 * @update
	 */
	public static String get(String key) {
		String value = null;
		if (SimpleStringUtils.hasText(key)) {
			try {
				value = resourceBundle.getString(key.trim());
			} catch (Exception e) {
				logger.error("读取cims.properties文件,根据key=" + key + ",获取值返回value为空。");
				value = null;
			}
		}
		return value;
	}
}
